package com.e3.basdoc.bank.client;

import java.util.List;

import com.e3.basdoc.bank.model.BankModel;
import com.e3.template.tgf.TGFHelper;
import com.e3.template.tgf.TGFTreePanelAsync;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class BankTreePanel extends TGFTreePanelAsync<BankModel> {
	
	private BankRPCServiceAsync service = BankRPCService.Util.getInstance();

	@Override
	public String getTreeDisplayFieldName() {
		return BankModel.NAME;
	}

	@Override
	public void excuteLoadModelChildren(final BankModel pModel,AsyncCallback<List<BankModel>> callback) {
		service.getBankChildren(pModel,callback);
	}

	@Override
	public String getRootDisplayName() {
		return BankMessages.INSTANCE.tree_root_name();
	}

	@Override
	protected boolean isRootModel(BankModel model) {
		return BankHelper.INSTANCE.isRootModel(model);
	}

}
